import request from '@/utils/request'

export const getAllRole = (params) => {
  return request({
    url: '/sys/role',
    params
  })
}
// 根据id查询企业
export const getCompanyId = id => {
  return request({
    url: `/company/${id}`
  })
}
// 根据id删除角色
export const delRole = id => {
  return request({
    url: `/sys/role/${id}`,
    method: 'DELETE'

  })
}
// 根据id查询角色详情
export const getRole = id => {
  return request({
    url: `/sys/role/${id}`
  })
}
export const updateRole = data => {
  return request({
    method: 'put',
    url: `/sys/role/${data.id}`,
    data
  })
}
// 添加角色
export const addRole = data => {
  return request({
    method: 'POST',
    url: '/sys/role',
    data
  })
}
